package com.example.demo.service.impl;

import com.example.demo.dao.LogSendProvinceMapper;
import com.example.demo.pojo.LogSendProvince;
import com.example.demo.service.LogSendProvinceService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.UUID;

@Service("LogSendProvinceService")
public class LogSendProvinceServiceImpl implements LogSendProvinceService {

    @Resource()
    private LogSendProvinceMapper logSendProvinceMapper;

    @Override
    public int createLogSendProvince(LogSendProvince bean){
        if (bean.getId() == null){
            String uuid = UUID.randomUUID().toString().replace("-","");
            bean.setId(uuid);
            LocalDateTime now = LocalDateTime.now();
            bean.setCreateTime(now);
        }
        int row = logSendProvinceMapper.insertOrUpdate(bean);
        return row;
    }

}
